package com.neusoft.yiyang.diet.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.neusoft.yiyang.common.entity.diet.FoodDict;
import com.neusoft.yiyang.common.entity.diet.vto.FoodDictWithTag;
import org.apache.ibatis.annotations.*;

import java.util.List;

@Mapper
public interface FoodDictMapper extends BaseMapper<FoodDict> {

    // 根据食材名称查询食材字典
    List<FoodDict> selectByFoodName(String foodName);

    // 查询所有食材字典
    List<FoodDict> listFoodWithTags();

    @Select("select * from food_tag_dict where tag_name = #{tagName}")
    List<FoodDictWithTag> getFoodWithTagByTag(String tagName);
}
